from rest_framework import serializers
from course import models
# 分类序列化

class CategorySer(serializers.ModelSerializer):
    class Meta:
        model = models.Category
        fields = ['id','cname']
class CategorySerializer(serializers.ModelSerializer):
    children = CategorySer(many=True)
    class Meta:
        model = models.Category
        fields = "__all__"